package com.tgpms.web.earlierStage.dao;

import java.util.List;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.tgpms.web.earlierStage.entity.UsersAuthority;


/**
* 表USERS_AUTHORITY -> null 的基本功能实现
*
* @author GK-B-P-GUAN_WEIQUAN-N
* @createDate 2019/12/24
*/
public interface UsersAuthorityMapper {
	
	//根据用户id批量删除
	@Delete("delete from users_authority where USERS_ID=#{usersId}")
	int deleteByUserId(String usersId);
	
    /**
     * null  deleteByPrimaryKey 实现
     * 
     * @param obsCode, usersId
     * @return null int
     * @author: GK-B-P-GUAN_WEIQUAN-N
     * @createDate: 2019-12-24 11:12:46
     */
    int deleteByPrimaryKey(@Param("obsCode") String obsCode, @Param("usersId") String usersId);

    /**
     * null  insert 实现
     * 
     * @param record
     * @return null int
     * @author: GK-B-P-GUAN_WEIQUAN-N
     * @createDate: 2019-12-24 11:12:46
     */
    int insert(UsersAuthority record);

    /**
     * null  insertSelective 实现
     * 
     * @param record
     * @return null int
     * @author: GK-B-P-GUAN_WEIQUAN-N
     * @createDate: 2019-12-24 11:12:46
     */
    int insertSelective(UsersAuthority record);

    /**
     * null  selectByPrimaryKey 实现
     * 
     * @param obsCode, usersId
     * @return null com.tgpms.web.earlierStage.entity.UsersAuthority
     * @author: GK-B-P-GUAN_WEIQUAN-N
     * @createDate: 2019-12-24 11:12:46
     */
    UsersAuthority selectByPrimaryKey(@Param("obsCode") String obsCode, @Param("usersId") String usersId);

    /**
     * null  updateByPrimaryKeySelective 实现
     * 
     * @param record
     * @return null int
     * @author: GK-B-P-GUAN_WEIQUAN-N
     * @createDate: 2019-12-24 11:12:46
     */
    int updateByPrimaryKeySelective(UsersAuthority record);

    /**
     * null  updateByPrimaryKey 实现
     * 
     * @param record
     * @return null int
     * @author: GK-B-P-GUAN_WEIQUAN-N
     * @createDate: 2019-12-24 11:12:46
     */
    int updateByPrimaryKey(UsersAuthority record);
    
    @Select("select OBS_CODE from users_authority where USERS_ID=#{usersId} and CHECK_YN='Y'")
    List<String> getCodeByUserid(String usersId);

    int batchInsert(List<UsersAuthority> list);
}